Skip to content

fix(web): add default thread env mode setting#892

Merged
juliusmarminge merged 5 commits intopingdotgg:mainfrom
binbandit:t3code/default-worktree-mode-toggle
Mar 13, 2026
Merged

fix(web): add default thread env mode setting#892
juliusmarminge merged 5 commits intopingdotgg:mainfrom
binbandit:t3code/default-worktree-mode-toggle

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 11, 2026

Summary

  • add a persisted app setting for the default draft-thread environment mode
  • use that setting when creating new draft threads so users do not need to re-toggle New worktree on each new thread
  • add tests covering app-settings persistence and backward-compatible defaults

Why

New draft threads always defaulted to local, even if a user consistently works in New worktree mode. The existing toggle only changed the current draft thread, so users had to repeat the same interaction on every new thread.

The right scope here is app-level persistence, not more draft-local state. That keeps existing thread behavior unchanged, preserves explicit overrides, and only affects brand-new draft thread creation.

Changes

  • extend web app settings with defaultThreadEnvMode
  • add a Settings toggle under Threads to switch the default between Local and New worktree
  • update sidebar new-thread creation to honor the persisted default unless an explicit envMode is already supplied
  • add tests for defaulting, invalid persisted values, and persisted worktree mode

UI changes

Screenshot 2026-03-11 at 7 56 24 pm

Validation

  • bun run test src/appSettings.test.ts src/composerDraftStore.test.ts in apps/web
  • bun fmt
  • bun lint
  • bun typecheck

Note

Add configurable default thread environment mode setting to web app

  • Adds defaultThreadEnvMode ("local" | "worktree", default "local") to appSettings.ts, persisted via AppSettingsSchema.
  • Adds a new "Threads" section in settings UI with a toggle and "Restore default" button for this setting.
  • Updates thread creation in Sidebar.tsx and the chat.newLocal keyboard shortcut in _chat.tsx to resolve env mode via resolveSidebarNewThreadEnvMode, using the app default instead of a hardcoded value.
  • Behavioral Change: the chat.newLocal shortcut no longer hardcodes "local" mode — it now follows the user's configured default.

Macroscope summarized 3ec278c.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 282d5b72-39d9-4e4c-bef7-12183b401e60

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 11, 2026
@binbandit binbandit changed the title Add default thread env mode setting fix(web): add default thread env mode setting Mar 11, 2026
@github-actions github-actions bot added the size:L 100-499 changed lines (additions + deletions). label Mar 13, 2026
@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Mar 13, 2026
@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Mar 13, 2026
@juliusmarminge juliusmarminge merged commit d0ae0ad into pingdotgg:main Mar 13, 2026
10 of 13 checks passed
aaditagrawal added a commit to aaditagrawal/t3code that referenced this pull request Mar 13, 2026
Upstream features:
- Selective file staging in commit dialog (pingdotgg#872)
- Compact Codex tool-call icons in chat timeline (pingdotgg#988)
- Replace worktree toggle with Select dropdown (pingdotgg#1001)
- Timestamp format override setting (pingdotgg#855)
- Preferred editor resolver + useLocalStorage helper (pingdotgg#662)
- Extract reusable clipboard hook and media queries (pingdotgg#1006)
- Default thread env mode setting (pingdotgg#892)
- Block image uploads during plan mode (pingdotgg#621)

Upstream bug fixes:
- Prompt editor + Plan mode cursor fixes (pingdotgg#867)
- Composer @file autocomplete cursor/spacing bugs (pingdotgg#936)
- Diff panel unclosable after retainSearchParams (pingdotgg#937)
- Fix agent response duration always 1ms (pingdotgg#866)
- Defer diff worker startup until diff opens (pingdotgg#934)
- Fix new-thread shortcuts when terminal focused (pingdotgg#984)
- PlanSidebar memory leak fix (pingdotgg#949)
- WebSocket error logging (pingdotgg#948)
- Desktop "Check for Updates" dialog (pingdotgg#955)
- macOS logo alignment fix (pingdotgg#960)

Upstream tooling:
- Upgrade oxfmt/oxlint versions (pingdotgg#1010)
- Update @vitejs/plugin-react to 6.0.0 (pingdotgg#1002)
- Upgrade marketing app to Astro 6 (pingdotgg#1005)

Conflict resolutions:
- workspaceEntries.ts: kept our zortos-ported fuzzy search (better
  ranked insertion) over upstream's pingdotgg#256
- appSettings.ts: merged our display settings with upstream's timestamp
  format and env mode settings
- MessagesTimeline.tsx: merged our showCommandOutput gating with
  upstream's compact tool-call icons
- DiffPanel.tsx: fixed duplicate useAppSettings import
- open.test.ts: added missing node:fs/os/path imports for new test
gabrielMalonso pushed a commit to gabrielMalonso/t3code that referenced this pull request Mar 14, 2026
Co-authored-by: Julius Marminge <julius0216@outlook.com>
gabrielMalonso added a commit to gabrielMalonso/t3code that referenced this pull request Mar 14, 2026
* remove triggers

* feat: replace worktree toggle with discoverable Select dropdown (pingdotgg#1001)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* fix(desktop): show dialog after "Check for Updates" menu action (pingdotgg#955)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* chore: Upgrade marketing app to Astro 6 (pingdotgg#1005)

* feat(github): add issue templates for automatic triage (pingdotgg#896)

* Actions dialog: autofocus script-name field (pingdotgg#912)

* chore: update actions/checkout and actions/github-script (pingdotgg#956)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Add Antigravity to supported editors in Open menu (macOS, Windows, and Linux) (pingdotgg#841)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* fix: block image uploads during plan mode questions (pingdotgg#621)

* chore: update @vitejs/plugin-react to 6.0.0 (pingdotgg#1002)

* fix(web): defer diff worker startup until diff opens (pingdotgg#934)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Extract reusable clipboard hook and standardize media queries (pingdotgg#1006)

Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>

* Upgrade oxfmt and oxlint tooling versions (pingdotgg#1010)

* chore: regenerate bun.lock after upstream cherry-picks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add compact Codex tool-call icons and details to the chat timeline (pingdotgg#988)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* feat: Allow Overriding Timestamp Format in Settings (pingdotgg#855)

* fix(web): add default thread env mode setting (pingdotgg#892)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Fix mod+N new thread flow and terminal split limits

- ensure `chat.new` creates a fresh draft after a promoted draft thread
- enforce terminal cap per split group (4) while allowing additional terminal groups
- refine sidebar row selected/active styling via shared class-name logic and tests

* Fix new-thread shortcuts when terminal is focused

- move chat-wide key handling into `_chat` route-level shortcut handler
- extract reusable `useHandleNewThread` hook and `isTerminalFocused` helper
- update browser WS fixture to support `terminalOpen` RPC shape

* fix: remove duplicate ChatRouteGlobalShortcuts from cherry-pick merge

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: composer @file autocomplete cursor and spacing bugs (pingdotgg#936)

* fix(web): resolve preferred editor from available editors & introduce `useLocalStorage` helper (pingdotgg#662)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* refactor: mover isToolLifecycleItemType para shared/providerRuntime e remover duplicação

---------

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Zortos <zortosdev@proton.me>
Co-authored-by: dpav02 <dpav02@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: 0x1f99d <crazywolf132@gmail.com>
Co-authored-by: Vitor Buzinaro <funny.hc@gmail.com>
Co-authored-by: Adam Naji <110662505+Bashamega@users.noreply.github.com>
Co-authored-by: WilgotM <wilgot10@yahoo.com>
Co-authored-by: (CJ) Chukwudi Nwobodo <142016413+chuks-qua@users.noreply.github.com>
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
Co-authored-by: Hugo Blom <6117705+huxcrux@users.noreply.github.com>
Co-authored-by: Magnus Buvarp <magnus.buvarp@gmail.com>
gabrielMalonso added a commit to gabrielMalonso/t3code that referenced this pull request Mar 14, 2026
* remove triggers

* feat: replace worktree toggle with discoverable Select dropdown (pingdotgg#1001)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* fix(desktop): show dialog after "Check for Updates" menu action (pingdotgg#955)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* chore: Upgrade marketing app to Astro 6 (pingdotgg#1005)

* feat(github): add issue templates for automatic triage (pingdotgg#896)

* Actions dialog: autofocus script-name field (pingdotgg#912)

* chore: update actions/checkout and actions/github-script (pingdotgg#956)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Add Antigravity to supported editors in Open menu (macOS, Windows, and Linux) (pingdotgg#841)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* fix: block image uploads during plan mode questions (pingdotgg#621)

* chore: update @vitejs/plugin-react to 6.0.0 (pingdotgg#1002)

* fix(web): defer diff worker startup until diff opens (pingdotgg#934)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Extract reusable clipboard hook and standardize media queries (pingdotgg#1006)

Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>

* Upgrade oxfmt and oxlint tooling versions (pingdotgg#1010)

* chore: regenerate bun.lock after upstream cherry-picks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add compact Codex tool-call icons and details to the chat timeline (pingdotgg#988)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* feat: Allow Overriding Timestamp Format in Settings (pingdotgg#855)

* fix(web): add default thread env mode setting (pingdotgg#892)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* Fix mod+N new thread flow and terminal split limits

- ensure `chat.new` creates a fresh draft after a promoted draft thread
- enforce terminal cap per split group (4) while allowing additional terminal groups
- refine sidebar row selected/active styling via shared class-name logic and tests

* Fix new-thread shortcuts when terminal is focused

- move chat-wide key handling into `_chat` route-level shortcut handler
- extract reusable `useHandleNewThread` hook and `isTerminalFocused` helper
- update browser WS fixture to support `terminalOpen` RPC shape

* fix: remove duplicate ChatRouteGlobalShortcuts from cherry-pick merge

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: composer @file autocomplete cursor and spacing bugs (pingdotgg#936)

* fix(web): resolve preferred editor from available editors & introduce `useLocalStorage` helper (pingdotgg#662)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* refactor: mover isToolLifecycleItemType para shared/providerRuntime e remover duplicação

* Add global favorite model toggle in provider picker

- persist a single favorite provider/model in app settings
- use favorite model as default for new local draft chats
- add star toggle UI in model picker with toast feedback
- cover favorite read/toggle behavior with app settings tests

* fix: validate provider in FavoriteModelSchema to prevent crash

Use Schema.Literals instead of Schema.String for the provider field
in FavoriteModelSchema, ensuring invalid provider values from
localStorage are rejected at the schema level. Add runtime guard in
getFavoriteModel as defense-in-depth. Remove unsafe `as ProviderKind`
casts in appSettings.ts and ChatView.tsx.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Zortos <zortosdev@proton.me>
Co-authored-by: dpav02 <dpav02@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: 0x1f99d <crazywolf132@gmail.com>
Co-authored-by: Vitor Buzinaro <funny.hc@gmail.com>
Co-authored-by: Adam Naji <110662505+Bashamega@users.noreply.github.com>
Co-authored-by: WilgotM <wilgot10@yahoo.com>
Co-authored-by: (CJ) Chukwudi Nwobodo <142016413+chuks-qua@users.noreply.github.com>
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
Co-authored-by: Hugo Blom <6117705+huxcrux@users.noreply.github.com>
Co-authored-by: Magnus Buvarp <magnus.buvarp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants